<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
	</body>
	<script type="text/javascript">
		//		function generateGUID() {
		//			let d = new Date().getTime();
		//			let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
		//				let r = (d + Math.random() * 16) % 16 | 0;
		//				d = Math.floor(d / 16);
		//				return(c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
		//			});
		//			return uuid;
		//		};
		//		generateGUID();
		//		console.log(generateGUID());
		function generateGUID() { //模拟生成设备号
			let d = new Date().getTime();
			let uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
				let r = (d + Math.random() * 16) % 16 | 0;
				d = Math.floor(d / 16);
				return(c == 'x' ? r : (r & 0x3 | 0x8)).toString(16);
			});
			return uuid;
		};
		var client_id = "";

		function have_client_id() {
			if(localStorage.client_id) {
				client_id = localStorage.client_id;
			} else {
				client_id = generateGUID();
				localStorage.client_id = client_id;
			}
		}
		have_client_id(); //检测本地是否有设备号，如果有的话，就使用本地的，如果没有的话，就生成
	</script>

</html>